package com.black.opsapi.feign.factory;

import com.black.opsapi.feign.RemotePermissionService;
import com.black.opsapi.feign.fallback.RemotePermissionServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author qiang.zhang
 * @date 2019/2/1
 */
@Component
public class RemotePermissionServiceFallbackFactory implements FallbackFactory<RemotePermissionService> {

	@Override
	public RemotePermissionService create(Throwable throwable) {
		RemotePermissionServiceFallbackImpl remotePermissionServiceFallback = new RemotePermissionServiceFallbackImpl();
		remotePermissionServiceFallback.setCause(throwable);
		return remotePermissionServiceFallback;
	}
}
